package net.techwatch.poi;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;

import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;

public class XlsDataSource<T> extends RowFileDataSource<T> {
	
	public XlsDataSource(Class<T> clazz, Configuration configuration,
			String path) throws IOException {
		super(clazz, configuration, path);
	}
	
	@Override
	protected void initReader(Class<T> clazz, Matcher<T> matcher, String path) throws IOException {
		InputStream inp = new FileInputStream(path);
		HSSFWorkbook wb = new HSSFWorkbook(new POIFSFileSystem(inp));
		
		this.reader = XlsReader.createXlsReader(clazz, matcher, wb.getSheetAt(0));
	}
	
	


}
